import request from '@/utils/request'

// 查询库存报损单(es_stock_damage_report)列表
export function listReport(query) {
  return request({
    url: '/system/report/list',
    method: 'get',
    params: query
  })
}

// 查询库存报损单(es_stock_damage_report)详细
export function getReport(id) {
  return request({
    url: '/system/report/' + id,
    method: 'get'
  })
}

// 新增库存报损单(es_stock_damage_report)
export function addReport(data) {
  return request({
    url: '/system/report',
    method: 'post',
    data: data
  })
}

// 修改库存报损单(es_stock_damage_report)
export function updateReport(data) {
  return request({
    url: '/system/report',
    method: 'put',
    data: data
  })
}

// 删除库存报损单(es_stock_damage_report)
export function delReport(id) {
  return request({
    url: '/system/report/' + id,
    method: 'delete'
  })
}


// 提交库存报损单
export function submitReport(id) {
  return request({
    url: '/system/report/submit/' + id,
    method: 'put'
  })
}

// 审核库存报损单
export function auditReport(id) {
  return request({
    url: '/system/report/audit/' + id,
    method: 'put'
  })
}

// 获取报损类型列表
export function getDamageTypes() {
  return request({
    url: '/system/report/damageTypes',
    method: 'get'
  })
}

// 获取带库存的商品列表
export function listGoodsWithStock(params) {
  return request({
    url: '/system/report/goodsList',
    method: 'get',
    params: params
  })
}
